1. Field of the Invention
The present invention relates to a network printer which performs printing on the basis of data received via a network such as a LAN (Local Area Network), and also to a network printing method.
The present application is based on Japanese Patent Application No. Hei. 10-291910, which is incorporated herein by reference.
2. Description of the Related Art
In a printer which is locally connected to a host computer via a parallel I/F or the like, print data are input basically as it is, and at a relatively constant rate. In such a local printer, therefore, it is requested to store received print data as they are into a reception buffer, and printing can be enabled by only sequentially taking out stored data and interpreting the data.
Recently, however, a network printer which is to be connected to a host computer via a network such as a LAN is widely used. In such a network, usually, data communication between the host computer and the printer is performed by using a protocol hierarchy in which plural protocols are layered. When print data are transmitted from the host computer, therefore, the print data are divided into packets of a variable or fixed length, and data other than the print data, such as a destination address, a source address, the data length, and a frame check are added to each packet. In the printer, extra data such as the destination address are removed away from the received packet while tracing back through the protocol hierarchy, and the original print data are then reconstructed.
In this way, in the case of a network printer, print data must be stored into a reception buffer after the data are reconstructed from a packet. Therefore, a network printer is provided with a dedicated CPU (Central Processing Unit) or MPU (Micro Processing unit), in addition to that for producing a print image.
In a network printer described above, the packet reception from a network and production of a print image are processed by different CPUs, respectively. The CPU for a communication process is used only for a network process, and the CPU for print image production is used for producing a print image (producing a print request), thereby producing problems in that the utilization ratios of the CPUs are low, and that the production cost is increased. When complex bidirectional communications are to be performed between the network printer and the host computer, a protocol for coupling the CPU for a communication process with the CPU for print image production is additionally required. Furthermore, data are transmitted between the CPUs, so that the number of operations of copying data between memories tends to be increased, thereby producing another problem in that the process efficiency is low.
In order to solve such problems, it is contemplated that a CPU of relatively high performance executes both a communication process (communication task) and an image production process (image production task). In this case, however, the use of the single CPU causes the process efficiency to be instead lowered unless executions of the tasks are suitably distributed. In the case where the operation state of the communication task continues for a long term, the packet reception from a network can be rapidly processed, but the operation state of the image production task is lowered, so that a long time period elapses before starting the actual printing, whereby the throughput of printing is lowered. In contrast, when the operation state of the image production task is enhanced, the packet reception is delayed and a long time period elapses before the host computer is released from the transmission of print data. Switching between tasks requires a time period of about several hundreds of microseconds. When the tasks are frequently switched over, therefore, waste switching periods are accumulated. As a result, there arises a fear that the process efficiency is lowered.
The invention has been conducted in view of various problems discussed above. It is an object of the invention to provide a network printer and a network printing method in which the operation states of reception of data from a network and image data production in a printer can be suitably controlled. It is another object of the invention to provide a network printer and a network printing method in which the execution privilege of a processing unit which is to be allocated to a communication process and an image production process is suitably controlled, thereby enabling both the processes to be efficiently executed.
In order to attain the objects, in the network printer of the invention, a communication process and an image production process are controlled in accordance with a rate of receiving data from a network and a data processing rate in a printer.
According to a first aspect of the invention, a network printer which performs printing on the basis of data received via a network is provided. The printer comprises: a communication processing section which receives data via a network; an image production processing section which interprets the data supplied from the communication processing section, and produces image data; a print processing section which controls a drive of a print engine on the basis of the image data supplied from the image production processing section, thereby performing printing; and an operation state controlling section which, in accordance with a rate of receiving data from the network and a data processing rate in the image production processing section, controls an operation state of the communication processing section and an operation state of the image production processing section.
Data (packet) which are transmitted from a host computer to a network such as a LAN are received by the communication processing section. Based on a protocol hierarchy and the like, the communication processing section configures print data from the received data. The image production processing section interprets the data supplied from the communication processing section, and produces image data. The print processing section controls the drive of the print engine on the basis of the image data, thereby performing printing.
The communication processing section and the image production processing section use computer resources such as a memory and a CPU. Typically, at least the communication processing section and the image production processing section can be executed by a single processing unit. When one of the processing sections occupies the computer resources for a long term, therefore, the execution of the other processing section is hindered. When the execution time period of the communication processing section is long, for example, the data reception from the network can be smoothly performed, but the image production process is delayed. In contrast, when the execution time period of the image production processing section is prolonged, the data reception from the network is delayed.
For example, it may be contemplated that executions of the processing sections are switched over at predetermined periods or at each time when a given amount of data have been received. The suitable execution time period of the communication processing section is affected by the rate of receiving data from the network, and that of the image production processing section is affected by the data processing rate of the image production process. The data receiving rate and the data processing rate are varied every moment in accordance with the situations. Namely, when the network is busy, the timing of a packet arrival from the network is unstable and the data processing rate is lowered. Even when the communication processing section is provided with the execution privilege of the CPU for a long term during a period when the network is busy, the substantial operation time period is short. Therefore, the computer resources are wastefully occupied, and a waste waiting time of the image production processing section is prolonged. In contrast, when the traffic congestion of the network is low in degree, packets successively arrive from the network. Therefore, the data reception is delayed unless the execution time period of the communication processing section is prolonged. On the other hand, with respect to the data processing rate in the image production processing section, the actually required processing time period is varied depending on the kind of the printing language, and the degree of complexity of an image constituting a page, and the like.
When a fixed switching operation based on, for example, a constant time period or a constant amount of data is performed, therefore, it is difficult to efficiently execute the communication process and the image production process. Switching between processings requires a given switching time period. When the processes are frequently switched over, therefore, waste switching periods are accumulated, so that the process efficiency of the whole system is lowered. In the invention, the operation state controlling section is disposed, and the operation states of the communication processing section and the image production processing section are controlled in accordance with the data receiving rate and the data processing rate. The operation state controlling section dynamically changes the operation states of the communication processing section and the image production processing section, based on the data receiving rate and the data processing rate. Even when the traffic congestion of the network, or the like is changed, therefore, the processing sections are enabled to suitably operate.
The operation state controlling section may control the transfer amount of data which are supplied from the communication processing section to the image production processing section. According to this configuration, it is possible to control the operation states of the communication processing section and the image production processing section.
The image production processing section is activated by occurrence of an event of a data entry from the communication processing section. When the transfer amount of data which are supplied from the communication processing section to the image production processing section is controlled, therefore, the communication processing section and the image production processing section are enabled to suitably operate.
When the data receiving rate is lower than the data processing rate, the operation state controlling section may decrease the data transfer amount, and, when the data receiving rate is higher than the data processing rate, may increase the data transfer amount.
When the data receiving rate is caused to be relatively lower than the data processing rate by traffic congestion of the network or the like, the transfer amount of data from the communication processing section to the image production processing section is decreased. Each time when a small amount of data is received, therefore, the communication processing section performs the operation of transferring data to the image production processing section. As a result, chances of activation of the image production processing section are increased, so that a waste waiting time of the image production processing section can be shortened. In contrast, when the data receiving rate is relatively higher than the data processing rate, the transfer amount of data from the communication processing section to the image production processing section is increased. Each time when a large amount of data is received, therefore, the communication processing section transfers the data to the image production processing section. As a result, the number of operations of switching between the communication processing section and the image production processing section can be reduced and the switching time period can be shortened.
The operation state controlling section may comprise plural memory blocks each of which has plural sizes and which are used for transferring data from the communication processing section to the image production processing section, and, in accordance with the data receiving rate and the data processing rate, may determine one of the memory blocks which is to be used next time.
The communication processing section stores data into a memory block which is delivered from the operation state controlling section. When the memory block is filled with data, the image production processing section is activated so as to read out the data from the memory block and then produce an image. When the size of a memory block which is used for data transfer between the communication processing section and the image production processing section is adjusted, therefore, the operation states of the processing sections can be suitably controlled.
When memory blocks of a size which is smaller than a size of a memory block that is used at a previous time are free in a number which is equal to or larger than a predetermined number, the operation state controlling section may select one of the memory blocks of a smaller size, when memory blocks of a size which is smaller than a size of the memory block that is used at the previous time are not free in a number which is equal to or larger than the predetermined number and a memory block of a size which is equal to the size of the memory block that is used at the previous time is free, select the memory block of the same size, and, when the memory block of the same size is not free and a memory block of a size which is larger in size than the size of the memory block that is used at the previous time is free, select the memory block of a larger size.
Each time when a data is received from the network, the communication processing section can configure the received data into print data, and then store the print data into a memory block. The image production processing section can be activated during a period when the communication processing section is not activated, so as to read out the print data from the memory block and produce an image.
The case where, at a certain timing, the rate of receiving data from the network is lower than the data processing rate means that the rate of forming memory blocks storing data is lower than that of forming free memory blocks. In the case where the data processing rate is constant, the time period which is required for reading out data from a memory block to make the memory block free is shorter as the size of the memory block is smaller. When the data receiving rate is lower than the data processing rate by a predetermined value or more, therefore, a process on memory blocks storing data advances. Consequently, memory blocks the number of which is larger than a predetermined number, and having a size which is smaller than the size of the memory block that is used at the previous time become free. In other words, the case where memory blocks the number of which is larger than a predetermined number, and having a size which is smaller than the size of the memory block that is used at the previous time become free means that the size of the memory block that is used at the previous time is too large in view of the difference between the data receiving rate and the data processing rate. When memory blocks the number of which is larger than the predetermined number and having a small size become free, therefore, data transfer between the communication processing section and the image production processing section is performed by using the memory blocks of a small size. According to this configuration, chances of activation of the image production processing section are increased, so that a waiting time can be shortened.
When memory blocks having a small size are free in a number which is not larger than the predetermined number and a memory block of a size which is equal to the size of the memory block that is used at the previous time is free, the data receiving rate substantially balances with the data processing rate. In this case, therefore, the memory block of the same size is selected. The case where also a memory block of the same size is not free means that the data receiving rate is higher than the data processing rate and memory blocks are sequentially filled with data. Therefore, memory blocks of a size which is larger than the size of the memory block that is used at the previous time, so that the amount of data which are supplied at a time into the image production processing section is increased. As a result, the number of switching operations can be reduced.
In this way, on the basis of the use states of the memory blocks, a memory block which is to be used next time is determined, whereby a suitable memory block can be selected without monitoring the data receiving rate and the data processing rate.
In the operation state controlling section, a memory block of minimum size may be set as an initial value.
Alternatively, in the operation state controlling section, a memory block of intermediate size may be set as an initial value.
When an intermediate size is set as the initial value, the possibility that the state is promptly transferred into the balanced state, i.e., the state in which a memory block of the same size is repeatedly used is increased. When a memory block of a size corresponding to the minimum one of print jobs which are usually possible is used as an intermediate size, the possibility that data can be received by using a reception block of a size which is suitable for the print job is increased. Therefore, image data can be produced by using only the initial reception block, so that the process efficiency is improved.
In accordance with the data receiving rate and the data processing rate, the operation state controlling section may determine a size of a memory block which is used for transferring data from the communication processing section to the image production processing section, and produce a memory block of the determined size.
That is, memory blocks of plural sizes are not previously prepared, a memory block of a suitable size may be produced in accordance with the data receiving rate and the data processing rate.
In this case, when the data receiving rate is lower than the data processing rate, the operation state controlling section may produce a memory block of a size which is smaller by a predetermined value or more than a size of a memory block that is used at a previous time; when the data receiving rate is higher than the data processing rate, produce a memory block of a size which is larger by a predetermined value or more than the size of the memory block that is used at the previous time; and, when the data receiving rate balances with the data processing rate, produce a memory block of a size which is within a predetermined range with respect to the size of the memory block that is used at the previous time.
The operation states of the communication processing section and the image production processing section can be suitably controlled by adjusting the size of a memory block in accordance with relationships between the data receiving rate and the data processing rate.
The communication processing section may be higher in priority for acquiring execution privilege in the processing unit, than the image production processing section.
According to this configuration, the data reception is processed with a higher priority, so that the computer can be early released.
According to a second aspect of the invention, there is provided a network printer comprising: a communication task of receiving data via a network; an image production task, having a lower priority than the communication task, of interpreting the data supplied from the communication task, and producing image data; and a print processing section which controls a drive of a print engine on the basis of the image data supplied from the image production task, a single central processing unit (CPU) switchably executing the communication task and the image production task, wherein, in accordance with a rate of receiving data which are supplied from the network to the communication task and a data processing rate in the image production task, an operation state of the image production task is controlled.
According to a second aspect of the invention, there is provided a network printing method in which a communication task of receiving data via a network, an image production task of interpreting the data supplied from the communication task, and producing image data, and a print task of performing printing on the basis of the image data supplied from the image production task are switchably executed a single central processing unit (CPU), a priority for acquiring execution privilege in the processing unit is higher in a sequence of the print task, the communication task, and the image production task, and the method comprises steps of: in accordance with a rate of receiving data which are supplied from the network to the communication task and a data processing rate in the image production processing task, determining a size of a memory block for storing data supplied to the image production task, so as to provide the image production task with a suitable execution time period; storing the data received from the network into a memory block of the determined size, by the communication task; informing the image production task that the data are stored into the memory block; reading data from the memory block to produce image data, by the image production task; informing the print task of the production of image data; and performing printing on the basis of the supplied image data, by the print task.
In the invention, the production task, the communication task, and the image production task are executed with giving priorities in this sequence by the single processing unit. According to this configuration, it is possible to attain the same effects as aforementioned.
According to a second aspect of the invention, there is provided a recording medium on which programs for controlling a network printer which performs printing on the basis of data received via a network are recorded, programs for causing a computer to realize: a communication processing section which receives data via a network; an image production processing section which interprets the data supplied from the communication processing section, and produces image data; a print processing section which controls a drive of a print engine on the basis of the image data supplied from the image production processing section, thereby performing printing; and an operation state controlling section which, in accordance with a rate of receiving data from the network and a data processing rate in the image production processing section, controls a transfer amount of data which are supplied from the communication processing section to the image production processing section, are recorded in a form in which the programs are readable and understandable by the computer.
When predetermined programs are read into a computer of a printer, it is possible to obtain a printer which exerts the same effects as those of the invention as aforementioned. As xe2x80x9crecording medium,xe2x80x9d various kinds of recording media such as a hard disk, a floppy disk, a memory, and an IC card may be used. Alternatively, a communication medium may be used by, for example, downloading programs via a network.